//
//  STStatisticsCell.m
//  YiYueStore
//
//  Created by zhouzhouzhou on 2018/10/16.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STStatisticsCell.h"

@implementation STStatisticsCell

-(void)setStatisticsWithDic:(STOrderSumCountSumModel *)dic type:(int)type{
    self.statisticsLab.hidden = YES;
    if(type==0){
        self.headImg.hidden = YES;
        self.nameLab.hidden = YES;
        self.orderNumLab.text = @"完成订单";
        self.performanceLab.text = @"业绩";
        self.incomeLab.text = @"收入";
        
    }else if(type==1){
        self.headImg.hidden = NO;
        self.nameLab.hidden = NO;
        
        self.orderNumLab.text = [NSString stringWithFormat:@"%d单" ,dic.orderNum];
        self.performanceLab.text = [NSString stringWithFormat:@"¥%0.2f" ,dic.incomeMoney];
        self.incomeLab.text =[NSString stringWithFormat:@"¥%0.2f" ,dic.achievementMoeny];
        if(self.isSum){
            self.statisticsLab.hidden = NO;
            self.headImg.hidden = YES;
            self.statisticsLab.text = @"总计";
        }else{
            [self.headImg sd_setImageWithURL:[NSURL URLWithString:dic.imgPath] placeholderImage:[UIImage imageNamed:@"h-hairEg"]];
            self.nameLab.text =dic.nickname;
            self.headImg.layer.cornerRadius = self.headImg.frame.size.width/2;
            self.headImg.layer.masksToBounds = YES;
        }
    }
    
}
@end

